<?php

class Recruiter_ProfileController extends Zend_Controller_Action
{
	private $identity;
	public function init()
	{
		$authData = Zend_Auth::getInstance ()->getStorage ()->read ();
		//Zend_Registry::get('logger')->debug($authData);
		if (is_array($authData) and $authData['identity'] != 'anon' and $authData) {
			$this->identity = $authData['identity'];
		}
		unset($authData);
	}
		
	public function viewAction()
	{
	$rec = new RP_Model_User_Recruiter();
	$rec->setUsername($this->identity);
		if($rec->populateUser()){
			//Personal Profile.
			$this->view->assign('recruiter_name',$rec->getRecruiter_name());
			$this->view->assign('recruiter_type',$rec->getRecruiter_type());
			$this->view->assign('addressline',$rec->getAddressline());
			$this->view->assign('city',$rec->getCity());
			$this->view->assign('district',$rec->getDistrict());
			$this->view->assign('state',$rec->getState());
			$this->view->assign('pincode',$rec->getPincode());
			$this->view->assign('contact_no',$rec->getContact_no());
			$this->view->assign('alternate_no',$rec->getAlternate_no());
			$this->view->assign('contact_person',$rec->getContact_person());
		}
		else{
			throw new Exception('Username cannot be resolved. username:'.$this->identity, Zend_Log::ERR);
		}
		
	}
}